package com.wuhong.listen;

import org.activiti.engine.delegate.DelegateTask;
import org.activiti.engine.delegate.TaskListener;

/**
 * @ClassName ActivitiListnener
 * @Description 监听器
 * @Author director吴
 * @Date 2022/4/27 11:18
 * @Version 1.0
 **/
public class ActivitiListnener implements TaskListener { //实现接口 - TaskListener


    @Override
    public void notify(DelegateTask delegateTask) {

        String taskName = delegateTask.getName();//任务名字=
        String eventName = delegateTask.getEventName();//事件名字=
        System.out.println("任务名字=" + taskName);
        System.out.println("事件名字=" + eventName);

        if (taskName.equals("经理审批") && "create".equals(eventName)) {
            delegateTask.setAssignee("张三");
        }


    }
}
